//导入vue-router
import { createRouter,createWebHistory } from "vue-router";

//导入登录页面
import Login from "../views/Login.vue";
//导入首页
import shouye from "../views/shouye.vue";
//导入文章分类
import wenfenlei from "../views/wenfenlei.vue";
//导入文章管理
import wenguanli from "../views/wenguanli.vue";
//导入基本资料
import personziliao from "../views/personziliao.vue";
//导入修改密码
import personmima from "../views/personmima.vue";
//导入更换头像
import persontouxiang from "../views/persontouxiang.vue";

//定义路由关系
const routes=[
    {path:'/',component:Login},
    {path:'/shouye',
     component:shouye,
     children:[
         {path:'/shouye/wenfenlei',component:wenfenlei},
         {path:'/shouye/wenguanli',component:wenguanli},
         {path:'/shouye/personziliao',component:personziliao},
         {path:'/shouye/personmima',component:personmima},
         {path:'/shouye/persontouxiang',component:persontouxiang}
     ]
    }
] 

//通过createRouter创建路由实例
const router=createRouter({
    history:createWebHistory(),
    routes:routes //路由关系
})

//导出路由实例
export default router;